# Create your models here.
from django.db import models



class Post(models.Model):

    title = models.CharField(max_length=255)

    machine_name = models.SlugField(max_length=255, primary_key=True)

    content = models.TextField(blank=True)

    publication_date = models.DateTimeField(auto_now_add=True)

    def __unicode__(self):
        return self.title

    def briefing(self):
        return self.content[:300] + '...'

    class Meta:
        ordering = ['-publication_date']
        

    

        